package com.jing.product.service.impl;

import com.jing.common.core.domain.R;
import com.jing.product.domain.po.ProductCategory;
import com.jing.product.mapper.ProductCategoryMapper;
import com.jing.product.service.ProductCategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author：HaoYunde
 * @Package：com.jing.product.service.impl
 * @Project：Jing
 * @name：ProductCategoryServiceImpl
 * @Date：2024/5/23 19:55
 */
@Service
public class ProductCategoryServiceImpl implements ProductCategoryService {
    @Autowired
    private ProductCategoryMapper productCategoryMapper;


    @Override
    public List<ProductCategory> findProductCategory() {
        return productCategoryMapper.findProductCategory();
    }

    @Override
    public void delect(Integer id) {
        int i=productCategoryMapper.delect(id);
        if (i==0){
            throw new RuntimeException("删除失败");
        }
    }

    @Override
    public List<ProductCategory> findProductCategoryEr(Integer id) {
        return productCategoryMapper.findProductCategoryEr(id);
    }

    @Override
    public void updatenavStatus(Integer id, Integer navStatus) {
        productCategoryMapper.updatenavStatus(id,navStatus);
    }

    @Override
    public void updateshowStatus(Integer id, Integer showStatus) {
        productCategoryMapper.updateshowStatus(id,showStatus);
    }
}
